describe('practice-3-1', function () {

    it("求某范围内完数的个数", function () {
        var arr_perfect_numbers = get_perfect_number(2,1000);
        expect(arr_perfect_numbers.length).toBe(3);
        expect(arr_perfect_numbers[0]<arr_perfect_numbers[arr_perfect_numbers.length-1]).toBe(true);
        for(var i = 0; i < arr_perfect_numbers.length; i ++)
        {
            var perfect_num = arr_perfect_numbers[i];
            var sum = 0;
            for(var j = 1; j < perfect_num; j ++)
            {
                if(perfect_num%j === 0)
                    sum += j;
            }
            expect(sum === perfect_num).toBe(true);
            console.info("perfect_num:"+perfect_num);
        }
    });

});